import 'package:flutter_test/flutter_test.dart';
import 'package:ums_pay/model/models.dart';
import 'package:ums_pay/ums_pay.dart';
import 'package:ums_pay/ums_pay_platform_interface.dart';
import 'package:ums_pay/ums_pay_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockUmsPayPlatform
    with MockPlatformInterfaceMixin
    implements UmsPayPlatform {
  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<UmsPayResponseResult?> pay(String payChannel, String data) {
    // TODO: implement pay
    throw UnimplementedError();
  }
}

void main() {
  final UmsPayPlatform initialPlatform = UmsPayPlatform.instance;

  test('$MethodChannelUmsPay is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelUmsPay>());
  });

  test('getPlatformVersion', () async {
    UmsPay umsPayPlugin = UmsPay();
    MockUmsPayPlatform fakePlatform = MockUmsPayPlatform();
    UmsPayPlatform.instance = fakePlatform;

    expect(await umsPayPlugin.getPlatformVersion(), '42');
  });
}
